//
//  HelpDetailVC.m
//  
//
//  Created by jiaming yan on 2018/3/15.
//

#import "HelpDetailVC.h"
#import "HelpFullTableViewCell.h"
#import "HelpTableViewCell.h"
#import "PlayVoice.h"
#import "QuestionModel.h"
#import "NSUDManager.h"
#import "QuestionAnwserModel.h"
#import <AVFoundation/AVFoundation.h>
#import "AddAnswerVC.h"
#import "EvaluateInsuredVC.h"
#import "HelpViewController.h"
#import "ReportOrderVC.h"
#import "ReportOrCancelViewController.h"
#import "StringAndIndexModel.h"

@interface HelpDetailVC ()<UITableViewDelegate,UITableViewDataSource,AVAudioPlayerDelegate>{
    AVAudioPlayer *_audioPlayer;
    AVPlayer *_avPlayer;
}
@property (strong, nonatomic) IBOutlet UIView *topView;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UIImageView *userHeadImageView;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *userNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@property (weak, nonatomic) IBOutlet UIButton *sameQuestionButton;
@property (weak, nonatomic) IBOutlet UILabel *tagLabel;

@property (weak, nonatomic) IBOutlet UIView *timeBackView;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *timeViewHeight;

@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (strong, nonatomic)  NSMutableArray *arrData;

@property (strong, nonatomic) QuestionModel *model;
@property (weak, nonatomic) IBOutlet UIButton *answerButton;
@property (strong, nonatomic) AVPlayer * player;

@end

@implementation HelpDetailVC
- (void)dealloc
{
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"问答详情";
    self.sameQuestionButton.layer.borderColor = UIColorFromRGB(0X00C6D5).CGColor;
    self.sameQuestionButton.layer.borderWidth = 1;
    self.sameQuestionButton.layer.cornerRadius = 10;
    [self loadTabbleView];

    [self requestHelp];
    
    [self downRefreshRequest];
    [self upRefreshRequest];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshHelpList) name:@"refreshHelpList" object:nil];
    [self rightButton];
}
-(void)rightButton{
    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn.frame = CGRectMake(0, 0, 30, 44);
    //    [backBtn setTitle:@"保存" forState:UIControlStateNormal];
    [backBtn setImage:IMAGE(@"ic_share_black") forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(help) forControlEvents:UIControlEventTouchUpInside];
    //    backBtn.backgroundColor = kGreenColor;
    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
    
    UIButton *backBtn1 = [UIButton buttonWithType:UIButtonTypeCustom];
    backBtn1.frame = CGRectMake(0, 0, 30, 44);
    //    backBtn1.backgroundColor = kRedColor;
    //    [backBtn setTitle:@"保存" forState:UIControlStateNormal];
    [backBtn1 setImage:IMAGE(@"ic_tip_black") forState:UIControlStateNormal];
    [backBtn1 addTarget:self action:@selector(complaint) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *backItem1 = [[UIBarButtonItem alloc] initWithCustomView:backBtn1];
    UIBarButtonItem *negativeSpacer = [[UIBarButtonItem alloc]
                                       initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace
                                       target:nil action:nil];
    negativeSpacer.width = -20;
    self.navigationItem.rightBarButtonItems = @[backItem,backItem1];
    
    if (IOS11Later) {
        backBtn.contentHorizontalAlignment =UIControlContentHorizontalAlignmentCenter;
        backBtn1.contentHorizontalAlignment =UIControlContentHorizontalAlignmentCenter;
    }
}
-(void)help{
    [self showShareView];
//    HelpViewController *vc = [[HelpViewController alloc]init];
//    [self.navigationController pushViewController:vc animated:YES];
}
-(void)complaint{
//    ReportOrderVC *vc = [[ReportOrderVC alloc]init];
//    [self.navigationController pushViewController:vc animated:YES];
    NSArray *msgs = @[@"信息内容不真实", @"泄露/索取个人隐私", @"封建迷信、反动思想、涉黄涉暴等政治敏感内容", @"发布广告/虚假信息/传销等信息", @"辱骂/诽谤/恶意骚扰等人身攻击", @"其他"];
    NSMutableArray *dataArray = [[NSMutableArray alloc] init];
    for (NSInteger i = 0; i < msgs.count; i++) {
        StringAndIndexModel *model = [[StringAndIndexModel alloc] init];
        if (i == 0) {
            model.index = 1;
        } else {
            model.index = 0;
        }
        model.msg = msgs[i];
        [dataArray addObject:model];
    }
    
    ReportOrCancelViewController *vc = [[ReportOrCancelViewController alloc] init];
    vc.index = 3;
    vc.dataArray = dataArray;
    vc.relatedId = self.relatedId;
    vc.relatedType = @"REPORT_TYPE_QUESTION";
    [self.navigationController pushViewController:vc animated:YES];
}
-(void)refreshHelpList{
    [self requestHelp];
    [self.tableView.mj_header beginRefreshing];
}
-(void)requestHelp{
    __weak typeof(self) weakSelf = self;
    [self.view bringSubviewToFront:self.loadingView];
    self.loadingView.hidden = NO;
    [self showProgressWithView:self.view animated:YES];
    [YJMSendRequest postDataWithParameters:@{@"questionId":self.relatedId} url:@"question/getQuestionByParam" result:^(NSDictionary *result, NSError *error) {
        result = [CommonUtils decryptDicWithResult:result];
        [self hideProgress:self.view animated:YES];
        if([result[@"result"] integerValue] == 1)
        {
            [weakSelf.view sendSubviewToBack:weakSelf.loadingView];
            weakSelf.model = [QuestionModel mj_objectWithKeyValues:result[@"data"]];
            [weakSelf loadViewData];
            [weakSelf.tableView.mj_header beginRefreshing];
        }else{
            [CommonUtils showToast:[result objectForKey:@"msg"]];
        }
        
    }];
}
-(void)loadViewData{
    
    self.contentLabel.text = self.model.content;
    [self.contentLabel sizeToFit];
    [self.userHeadImageView sd_setImageWithURL:[NSURL URLWithString:ImageURL(self.model.publisherHeadImg)] placeholderImage:IMAGE(@"默认图")];
    self.userNameLabel.text = self.model.publisher;
    self.priceLabel.text = [NSString stringWithFormat:@"赏金￥%@",self.model.bonus];
    self.tagLabel.text = [NSString stringWithFormat:@"#%@#",self.model.relatedTag];
    self.timeLabel.text = [NSString stringWithFormat:@"%@结束",self.model.closeTime];
    UserModel *user = [NSUDManager currentUser];

    
    if (self.model.isClose) {
        /**已关闭*/
        self.typeLabel.hidden = NO;
        self.sameQuestionButton.hidden = YES;
        self.timeBackView.hidden = YES;
        self.timeViewHeight.constant = 9;
        self.answerButton.hidden = YES;
        self.topView.frame = CGRectMake(0, 0, kScreenWidth, 121+self.contentLabel.mj_h );
    }else{
        self.typeLabel.hidden = YES;
        self.sameQuestionButton.hidden = NO;
        self.timeBackView.hidden = NO;
        self.timeViewHeight.constant = 34;
        self.topView.frame = CGRectMake(0, 0, kScreenWidth, 146+self.contentLabel.mj_h );
        if ([user.userId isEqualToString:self.model.publisherId]) {
            /**我本人发布的*/
            self.sameQuestionButton.hidden = YES;
            self.answerButton.hidden = YES;
        }else{
            
        }
    }
//    self.topView.backgroundColor = kRedColor;
    self.tableView.tableHeaderView = self.topView;
    
   
}
/*
 方法描述:
 加载列表
 
 参数说明:
 <#参数说明#>
 
 返回结果:
 <#返回结果#>
 
 */
-(void)loadTabbleView{
    [self.tableView registerNib:[UINib nibWithNibName:@"HelpFullTableViewCell" bundle:nil] forCellReuseIdentifier:@"HelpFullTableViewCell"];
    [self.tableView registerNib:[UINib nibWithNibName:@"HelpTableViewCell" bundle:nil] forCellReuseIdentifier:@"HelpTableViewCell"];
    
    self.tableView.tableFooterView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 49)];
    self.tableView.estimatedRowHeight = 184.0f;
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    if (@available(iOS 11.0, *)) {
        self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        // Fallback on earlier versions
    }
}
#pragma mark ------tableView代理
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.arrData.count;
}

//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
//    return 65;
//}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    
    
        QuestionAnwserModel *model = self.arrData[indexPath.row];
    //    cell.titleName.text = model.title;
    if (model.isAccept) {
//
        static NSString *identifier = @"HelpFullTableViewCell";
        HelpFullTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
        UserModel *user = [NSUDManager currentUser];
        /**评价*/
    
        
        NSDictionary *evaluate = nil;
        NSDictionary *backEvaluate = nil;
        NSArray *evaluateArr = model.evaluations;
        for (NSInteger i = 0; i<evaluateArr.count; i++) {
            NSDictionary *dic = evaluateArr[i];
            if ([dic[@"evaluateType"] isEqualToString:@"EVALUATE_TYPE_PUBLISHER"]) {
                /**黑色问答*/
                evaluate = dic;
            }else if ([dic[@"evaluateType"] isEqualToString:@"EVALUATE_TYPE_RESPONDENT"]){
                /**绿色问答*/
                backEvaluate = dic;
            }
        }
        [cell.evaluateHeadImageView sd_setImageWithURL:[NSURL URLWithString:ImageURL(evaluate[@"publisherHeadImg"])] placeholderImage:IMAGE(@"默认图")];
        cell.evaluateContentLabel.text = evaluate[@"content"];
        cell.priceLabel.text = [NSString stringWithFormat:@"¥%@",self.model.bonus];
        if (backEvaluate[@"content"]) {
            cell.evaluateBackLabel.text = [NSString stringWithFormat:@"同事回复：%@",backEvaluate[@"content"]];
        }else{
            cell.evaluateBackLabel.text = @" ";
        }
        
        if ([user.userId isEqualToString:[NSString stringWithFormat:@"%zd",model.publisherId]] &&evaluate!=nil&&backEvaluate == nil){
            cell.explainEvaluateButton.hidden = NO;
        }else{
            cell.explainEvaluateButton.hidden = YES;
        }
        cell.explainEvaluateButton.tag = indexPath.row;
        [cell.explainEvaluateButton addTarget:self action:@selector(explainEvaluateClick:) forControlEvents:UIControlEventTouchUpInside];
        
        /**大众化*/
        [cell.userHeadImageView sd_setImageWithURL:[NSURL URLWithString:ImageURL(model.publisherHeadImg)] placeholderImage:IMAGE(@"默认图")];
        cell.userDetailLabel.text = [NSString stringWithFormat:@"%@ | %@",model.publisher,model.positionName];
        cell.timeLabel.text = model.releaseTime;
        cell.audioLengthLabel.text = [CommonUtils timeIntervalWithDate:[model.soundLength integerValue]/1000];
        cell.buyCountLabel.text = [NSString stringWithFormat:@"%zd人已购",model.purchasedCount];
        
        cell.voiceView.hidden = YES;
        cell.wordView.hidden = YES;
        cell.contentLabel.hidden = YES;
        
        
        if ([model.anwserType isEqualToString:@"ANWSER_TYPE_SOUND"]) {
            /**语音*/
            cell.voiceView.hidden = NO;
            
        }else  if ([model.anwserType isEqualToString:@"ANWSER_TYPE_WORDS"]) {
            /**文字*/
            if (model.isPurchased || [user.userId isEqualToString:[NSString stringWithFormat:@"%zd",model.publisherId]]||[user.userId isEqualToString:self.model.publisherId]) {
                cell.contentLabel.hidden = NO;
                cell.contentLabel.text = model.content;
                [cell.contentLabel sizeToFit];
                cell.contentLabelHeight.constant = cell.contentLabel.mj_h ;
            }else{
                cell.contentLabelHeight.constant = 28;
                cell.wordView.hidden = NO;
                cell.wordLabel.text = [NSString stringWithFormat:@"1元偷偷看，共%zd个字",model.content.length];
            }
        }
        cell.audioButton.tag = indexPath.row;
        cell.wordButton.tag = indexPath.row;
        [cell.audioButton addTarget:self action:@selector(voiceButonClick:) forControlEvents:UIControlEventTouchUpInside];
        [cell.wordButton addTarget:self action:@selector(voiceButonClick:) forControlEvents:UIControlEventTouchUpInside];
        
        if (model.isPurchased ||  [user.userId isEqualToString:[NSString stringWithFormat:@"%zd",model.publisherId]]||[user.userId isEqualToString:self.model.publisherId]) {
            cell.wordLabel.text = @"免费查看";
            cell.audioTyepLabel.text = @"免费偷听";
        }else{
            cell.audioTyepLabel.text = @"1元偷听";
            cell.wordLabel.text = [NSString stringWithFormat:@"1元偷偷看，共%zd个字",model.content.length];
        }
        return cell;
    }else{
        static NSString *identifier = @"HelpTableViewCell";
        HelpTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
        cell.selectionStyle =  UITableViewCellSelectionStyleNone;
        [cell.userHeadImageView sd_setImageWithURL:[NSURL URLWithString:ImageURL(model.publisherHeadImg)] placeholderImage:IMAGE(@"默认图")];
        cell.userDetailLabel.text = [NSString stringWithFormat:@"%@ | %@",model.publisher,model.positionName];
        cell.timeLabel.text = model.releaseTime;
        cell.audioLengthLabel.text = [CommonUtils timeIntervalWithDate:[model.soundLength integerValue]/1000];
        cell.buyCountLabel.text = [NSString stringWithFormat:@"%zd人已购",model.purchasedCount];
        UserModel *user = [NSUDManager currentUser];
        if (!self.model.isClose &&[user.userId isEqualToString:[NSString stringWithFormat:@"%@",self.model.publisherId]]) {
            cell.adoptButton.hidden = NO;
        }else{
            cell.adoptButton.hidden = YES;
        }
        cell.adoptButton.tag = indexPath.row;
        [cell.adoptButton addTarget:self action:@selector(adoptButtonClick:) forControlEvents:UIControlEventTouchUpInside];
        cell.voiceView.hidden = YES;
        cell.wordView.hidden = YES;
        cell.contentLabel.hidden = YES;
        
        
        if ([model.anwserType isEqualToString:@"ANWSER_TYPE_SOUND"]) {
            /**语音*/
            cell.voiceView.hidden = NO;
            
        }else  if ([model.anwserType isEqualToString:@"ANWSER_TYPE_WORDS"]) {
            /**文字*/
            if (model.isPurchased || [user.userId isEqualToString:[NSString stringWithFormat:@"%zd",model.publisherId]]||[user.userId isEqualToString:self.model.publisherId]) {
                cell.contentLabel.hidden = NO;
                cell.contentLabel.text = model.content;
                [cell.contentLabel sizeToFit];
                cell.contentLabelHeight.constant = cell.contentLabel.mj_h ;
            }else{
                cell.contentLabelHeight.constant = 28;
                cell.wordView.hidden = NO;
                cell.wordLabel.text = [NSString stringWithFormat:@"1元偷偷看，共%zd个字",model.content.length];
            }
        }
        cell.audioButton.tag = indexPath.row;
        cell.wordButton.tag = indexPath.row;
        [cell.audioButton addTarget:self action:@selector(voiceButonClick:) forControlEvents:UIControlEventTouchUpInside];
        [cell.wordButton addTarget:self action:@selector(voiceButonClick:) forControlEvents:UIControlEventTouchUpInside];
        
        if (model.isPurchased ||  [user.userId isEqualToString:[NSString stringWithFormat:@"%zd",model.publisherId]]||[user.userId isEqualToString:self.model.publisherId]) {
            cell.wordLabel.text = @"免费查看";
            cell.audioTyepLabel.text = @"免费偷听";
        }else{
            cell.audioTyepLabel.text = @"1元偷听";
            cell.wordLabel.text = [NSString stringWithFormat:@"1元偷偷看，共%zd个字",model.content.length];
        }
        return cell;
    }

    
    
}
-(void)voiceButonClick:(UIButton *)sender{
    QuestionAnwserModel *model = self.arrData[sender.tag];
    UserModel *user = [NSUDManager currentUser];
    if (model.isPurchased || [user.userId isEqualToString:[NSString stringWithFormat:@"%zd",model.publisherId]]||[user.userId isEqualToString:self.model.publisherId]) {
        if ([model.anwserType isEqualToString:@"ANWSER_TYPE_SOUND"]) {
            /**语音*/
            [PlayVoice audioPlayWithUrl:model.soundKey];
        }else  if ([model.anwserType isEqualToString:@"ANWSER_TYPE_WORDS"]) {
            /**文字*/
           
        }
        
    }else{
        /**偷听*/
        [self showProgressWithView:self.view animated:YES];
        __weak typeof(self) weakSelf = self;
        [ [CommonUtils sharedCommonUtils] payWithType:@"GOODS_TYPE_TT" relatedId:[NSString stringWithFormat:@"%zd",model.anwserId] result:^(NSDictionary *result, BOOL paySuccess) {
            [self hideProgress:self.view animated:YES];
            if (paySuccess) {
                
                [weakSelf.tableView.mj_header beginRefreshing];
                [PlayVoice audioPlayWithUrl:model.soundKey];
            }else{
//                [CommonUtils showToast:[result objectForKey:@"msg"]];
            }
        }];
    }
}

- (void )tableView:(UITableView *)tableView didSelectRowAtIndexPath:(nonnull NSIndexPath *)indexPath
{

}

#pragma mark -
#pragma mark 下拉刷新
- (void)downRefreshRequest //内部方法改
{
    __weak typeof(self) weakSelf = self;
    MJRefreshGifHeader *header = [MJRefreshGifHeader headerWithRefreshingBlock:^{
        
        weakSelf.page = kStartPage;
        [YJMSendRequest postDataWithParameters:@{@"questionId":self.relatedId,@"pageSize":kNumOfPageSize,@"pageNo":[NSNumber numberWithInteger:weakSelf.page]} url:@"question/getQuestionAnwserByParam" result:^(NSDictionary *result, NSError *error) {
            result = [CommonUtils decryptDicWithResult:result];
            [self hideProgress:self.view animated:YES];
            if([result[@"result"] integerValue] == 1)
            {
                self.arrData = [NSMutableArray arrayWithArray:[QuestionAnwserModel mj_objectArrayWithKeyValuesArray:result[@"data"][@"list"]]];
                if (weakSelf.arrData.count < kNumOfPageIntSize) {
                    [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];

                }else{
                    [weakSelf.tableView.mj_footer endRefreshing];
                }
                [weakSelf.tableView.mj_header endRefreshing];
                
            }else{
                [weakSelf.tableView.mj_header endRefreshing];
                [weakSelf.tableView.mj_footer endRefreshing];
                
                [CommonUtils showToast:[result objectForKey:@"msg"]];
            }
            [weakSelf.tableView reloadData];
        }];
    }];
    MJHEADER;
    
    
    self.tableView.mj_header = header;
    
}
#pragma mark 上拉加载
- (void)upRefreshRequest //内部方法改
{
    __weak typeof(self) weakSelf = self;
    
    MJRefreshBackGifFooter *footer = [MJRefreshBackGifFooter footerWithRefreshingBlock:^{
        weakSelf.page ++;
        
        
         [YJMSendRequest postDataWithParameters:@{@"questionId":self.relatedId,@"pageSize":kNumOfPageSize,@"pageNo":[NSNumber numberWithInteger:weakSelf.page]} url:@"question/getQuestionAnwserByParam" result:^(NSDictionary *result, NSError *error){
            result = [CommonUtils decryptDicWithResult:result];
            [self hideProgress:self.view animated:YES];
            if([result[@"result"] integerValue] == 1)
            {
                NSArray *arrTemp = [QuestionAnwserModel mj_objectArrayWithKeyValuesArray:result[@"data"][@"list"]];
                [self.arrData addObjectsFromArray:arrTemp];
                if (arrTemp.count < kNumOfPageIntSize) {
                    [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];

                }else{
                    [weakSelf.tableView.mj_footer endRefreshing];
                }
                [weakSelf.tableView.mj_header endRefreshing];
                
            }else{
                [weakSelf.tableView.mj_header endRefreshing];
                [weakSelf.tableView.mj_footer endRefreshing];
                
                [CommonUtils showToast:[result objectForKey:@"msg"]];
            }
            [weakSelf.tableView reloadData];
        }];
    }];
    
    MJFOOTER;
    self.tableView.mj_footer = footer;
    
    
}
-(void)explainEvaluateClick:(UIButton *)sender{
    QuestionAnwserModel *model = self.arrData[sender.tag];
    EvaluateInsuredVC *vc =[[EvaluateInsuredVC alloc]init];
    vc.relatedId = [NSString stringWithFormat:@"%@",self.model.questionId];
    vc.type = 2;
    vc.modalPresentationStyle=UIModalPresentationOverCurrentContext;
    [vc setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    [self presentViewController:vc animated:YES completion:^{}];
}
-(void)adoptButtonClick:(UIButton *)sender{
    QuestionAnwserModel *model = self.arrData[sender.tag];
    EvaluateInsuredVC *vc =[[EvaluateInsuredVC alloc]init];
    vc.relatedId = [NSString stringWithFormat:@"%@",self.model.questionId];
    vc.type = 2;
    vc.anwserId = model.anwserId;
    vc.modalPresentationStyle=UIModalPresentationOverCurrentContext;
    [vc setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
    [self presentViewController:vc animated:YES completion:^{}];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)sameQuestionClick:(id)sender {
    __weak typeof(self) weakSelf = self;
    [self showProgressWithView:self.view animated:YES];
    [YJMSendRequest postDataWithParameters:@{@"questionId":self.relatedId} url:@"question/releaseSameQuestion" result:^(NSDictionary *result, NSError *error) {
        result = [CommonUtils decryptDicWithResult:result];
        [self hideProgress:self.view animated:YES];
        if([result[@"result"] integerValue] == 1)
        {
            ALERT_VIEW(@"同问完成");
            
        }else{
            
            
            [CommonUtils showToast:[result objectForKey:@"msg"]];
        }
        
    }];
}
- (IBAction)answerButtonClick:(id)sender {
    AddAnswerVC *vc = [[AddAnswerVC alloc]init];
    vc.model = self.model;
    [self.navigationController pushViewController:vc animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
